/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package qs.crm.modules.client.cstCustomer.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author tong
* @date 2023-05-31
**/
@Entity
@Data
@Table(name="cst_customer")
public class CstCustomer implements Serializable {

    @Id
    @Column(name = "`cust_no`")
    @ApiModelProperty(value = "客户编号")
    private Long custNo;

    @Column(name = "`cust_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "客户名称")
    private String custName;

    @Column(name = "`cust_region`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "地区")
    private String custRegion;

    @Column(name = "`cust_manager_id`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "客户经理编号")
    private Long custManagerId;

    @Column(name = "`cust_manager_name`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "客户经理")
    private String custManagerName;

    @Column(name = "`cust_level_label`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "客户等级")
    private String custLevelLabel;

    @Column(name = "`cust_satisfy`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "满意度")
    private Integer custSatisfy;

    @Column(name = "`cust_credit`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "信用度")
    private Integer custCredit;

    @Column(name = "`cust_addr`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "地址")
    private String custAddr;

    @Column(name = "`cust_zip`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "邮政编码")
    private String custZip;

    @Column(name = "`cust_tel`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "电话")
    private String custTel;

    @Column(name = "`cust_fax`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "传真")
    private String custFax;

    @Column(name = "`cust_website`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "网址")
    private String custWebsite;

    @Column(name = "`cust_licence_no`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "营业执照注册号")
    private String custLicenceNo;

    @Column(name = "`cust_chieftain`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "法人")
    private String custChieftain;

    @Column(name = "`cust_bankroll`")
    @ApiModelProperty(value = "注册资金")
    private Long custBankroll;

    @Column(name = "`cust_turnover`")
    @ApiModelProperty(value = "年营业额")
    private Long custTurnover;

    @Column(name = "`cust_bank`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "开户银行")
    private String custBank;

    @Column(name = "`cust_bank_account`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "银行账号")
    private String custBankAccount;

    @Column(name = "`cust_local_tax_no`")
    @ApiModelProperty(value = "地税登记号")
    private String custLocalTaxNo;

    @Column(name = "`cust_national_tax_no`")
    @ApiModelProperty(value = "国税登记号")
    private String custNationalTaxNo;

    @Column(name = "`cust_status`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "客户状态")
    private String custStatus;

    public void copy(CstCustomer source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
